<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<input id="orderStatus" type="hidden" value="">
<input id="orderIsOverSea" type="hidden" value="false">
<input id="orderIsYuncang" type="hidden" value="false">
<input type="hidden" id="pageTag" value="0"/>
<div id="ceilingDiv" class="ceilingDiv ceiling-div">
		<div class="ceiling-in m-left10">
		<div class="dropdown btn-dropdown pull-left">
					<button class="button btn-determine dropdown-toggle" style="width:auto;" type="button" uid="dropdownMenu10" data-toggle="dropdown">
						批量发消息<i class="iconfont icon_down"></i>
					</button>
					<ul class="dropdown-menu menu" role="menu" aria-labelledby="dropdownMenu10">
						<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="batchShowReply(1);">批量给 eBay 发消息</a></li>
							</ul>
				</div>
				<div class="dropdown btn-dropdown pull-left m-left10">
					<button class="button btn-determine dropdown-toggle" style="width:auto;" type="button" uid="dropdownMenu0" data-toggle="dropdown">
						批量操作<i class="iconfont icon_down"></i>
					</button>
					<ul class="dropdown-menu menu" role="menu" aria-labelledby="dropdownMenu0">
						<li class="default">批量操作</li>
						<li><a href="javascript:" onclick="batchBlackList();">批量标记黑名单</a></li>
						<li class="dropdown-submenu selCustomTagsBox">
							<a class="removefromcart dropdownSubmenuA selCustomTagsBtn" href="javascript:">批量标记<span class="myjCaretRight" style="margin-top:3px;color:#999;"></span></a>
							<ul class="dropdown-menu">
								<li class="custom-sign dropdown-batch">
									<div class="signDropdown">
										<div class="cont">
											<ul class="dropBatchSetCusBox">
												<li>
													<a class="signCont moduleA" href="javascript:" data-type="0" uid="moduleA">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleB" href="javascript:" data-type="0" uid="moduleB">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleC" href="javascript:" data-type="0" uid="moduleC">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleD" href="javascript:" data-type="0" uid="moduleD">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleE" href="javascript:" data-type="0" uid="moduleE">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleF" href="javascript:" data-type="0" uid="moduleF">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleW" href="javascript:" data-type="0" uid="moduleW">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleX" href="javascript:" data-type="0" uid="moduleX">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleY" href="javascript:" data-type="0" uid="moduleY">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleZ" href="javascript:" data-type="0" uid="moduleZ">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li class="sign-footer">
													<button class="button btn-determine" onclick="batchSetCustomComment(2,this);">确定</button>
													<a class="pull-right" href="javascript:" onclick="batchInitCustomComment();">清除已有标记</a>
												</li>
											</ul>
										</div>
									</div>
								</li>
							</ul>
						</li>
						<li><a href="javascript:" onclick="showBatchComment(0);">批量拣货说明</a></li>
						<li><a href="javascript:" onclick="showBatchComment(1);">批量客服备注</a></li>
					</ul>
				</div>
			<div class="dropdown btn-dropdown pull-right m-left10 menu-right">
					<button class="button btn-determine dropdown-toggle" style="width:auto;" type="button" id="exportOrderMenuAll" data-toggle="dropdown" aria-expanded="false">
						导出订单<i class="iconfont icon_down"></i>
					</button>
					<ul class="dropdown-menu menu" role="menu" aria-labelledby="exportOrderMenuAll">
						<li class="default">导出订单</li>
						<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="showExportModal('order');">按时间导出</a></li>
						<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="showExcelSelectAndAll(0,'');">导出勾选的订单</a></li>
						<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="showExcelSelectAndAll(1,'');">导出全部页订单</a></li>
					</ul>
				</div>
			</div>
	</div>

<div class="tab-content mTop10" style="width: 80%;float: left;margin-left: 15px;">
	<div id="commSearchDiv"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!--右则搜索通用-->
<div id="categoryNav"  class="col-xs-12 myj-crumbs">
	<span>当前位置：</span>
	<span>订单</span>
	<span style="font-family:simsun">&gt;</span>
	<span id="cNavSpan">
		订单搜索</span>
	<a href="https://help.dianxiaomi.com/pre/getContent.htm?id=33" target="_blank" class="pull-right">查看帮助</a>
</div>
<div  class="col-xs-12 p0 mTop5">
			<div class="col-xs-12 p0 borderBtm">
				<ul class="ulBtn text-center p0" style="min-width:450px;margin:0 0 0 10px;">
					<li class="liBtn liFoucs" >120天内订单</li>
					<li class="liBtn " >历史订单</li>
				</ul>
			</div>
		</div>
	<div class="col-xs-12 border3 borderBottomNo borderTopNo orderFiltrateIsFoldBox hide" style="position:relative;">
	<div class="col-xs-12 p0">
		<table class="searchTab">
			<tr>
				<td class="tit">平台渠道：</td>
				<td class="con">
					<a href="javascript:" class="mRight15 myj-aFocus myj-active">全部</a>
					<!---
					<% channel.forEach(function(item){%>
						<a class="mRight15 myj-aFocus" href="javascript:"><%=item.title %></a>
					 <% }) %>
						</td>
						--->
			</tr>
		</table>
	</div>
	<div class="rightTab dataTypeClick" style="position:absolute;right:15px;">
			<span class="rightTabActive" data-type="1">筛选</span>
			<span class="" data-type="2">搜索</span>
		</div>
	<div class="col-xs-12 p0">
		<table class="searchTab">
			<tr>
				<td class="tit">店铺账号：</td>
				<td class="con" id="shopDiv">
					<a href="javascript:" class="mRight15 myj-aFocus myj-active">全部</a>
					<!---
					<% acount.forEach(function(item){%>
						<a class="m-right15 myj-aFocus" href="javascript:">
						            <%=item.title%>
								</a>
					 <% }) %>
					--->
					
						</td>
			</tr>
		</table>
	</div>
</div>
<div class="tab-content col-xs-12 border3 borderTopNo orderFiltrateIsFoldBox hide" style="position:relative;">
	<div role="tabpanel" class="tab-pane active col-xs-12 p0">
		<div class="col-xs-12 dataType myj-show p0">
			<div class="col-xs-12 p0">
					<table class="searchTab">
						<tr>
							<td class="tit">订单状态：</td>
							<td class="con">
								<a href="javascript:" class="mRight20 myj-aFocus myj-active">全部</a>
								<a href="javascript:" class="mRight20 myj-aFocus">未付款</a>
								<a href="javascript:" class="mRight20 myj-aFocus">风控中</a>
								<a href="javascript:" class="mRight20 myj-aFocus">待审核</a>
								<a href="javascript:" class="mRight20 myj-aFocus">待处理</a>
								<a href="javascript:" class="mRight20 myj-aFocus">已处理</a>
								<a href="javascript:" class="mRight20 myj-aFocus">待打单（有货）</a>
								<a href="javascript:" class="mRight20 myj-aFocus">待打单（缺货）</a>
								<a href="javascript:" class="mRight20 myj-aFocus">待打单（有异常）</a>
								<a href="javascript:" class="mRight20 myj-aFocus">已交运</a>
								<a href="javascript:" class="mRight20 myj-aFocus">已退款</a>
								<a href="javascript:" class="mRight20 myj-aFocus">已忽略</a>
								<a href="javascript:" class="mRight20 myj-aFocus">已完成</a>
							</td>
						</tr>
					</table>
				</div>
			<div class="col-xs-12 p0">
					<table class="searchTab noRightPd">
						<tr>
							<td class="tit" style="padding-top:8px;">国家区域：</td>
							<td></td>
						</tr>
					</table>
				</div>
			<div class="col-xs-12 p0" id="authIdDiv">
					<table class="searchTab">
						<tr>
							<td class="tit">物流方式：</td>
							<td class="con">
								<a href="javascript:" class="mRight20 myj-aFocus myj-active">全部</a>
								<a href="javascript:" class="mRight20 myj-aFocus">其它</a>
							</td>
						</tr>
					</table>
				</div>
			</div>
	</div>
</div>
<div class="tab-content col-xs-12 border3 borderTopNo p-top15" style="position:relative;">
		<span class="order-filtrate-down orderFiltrateFold" data-type="show"></span>
		<div class="tab-pane active col-xs-12 p0" role="tabpanel">
			<div class="col-xs-12 p0" id="orderFieldDiv">
				<table class="searchTab">
					<tr>
						<td class="tit p-top0">排序方式：</td>
						<td class="con p-top0">
							<a href="javascript:" class="mRight20 myj-aFocus">按产品SKU&nbsp;<span class="mRight5" style="margin-top: -4px;"></span></a>
							<a href="javascript:" class="mRight20 myj-aFocus myj-active">按下单时间&nbsp;<span  style="margin-top: -4px;" class=" myjCaretDown mRight5"></span></a>
							<a href="javascript:" class="mRight20 myj-aFocus">按剩余发货时间&nbsp;<span class="mRight5" style="margin-top: -4px;"></span></a>
							<a href="javascript:" class="mRight20 myj-aFocus">按订单金额&nbsp;<span class="mRight5" style="margin-top: -4px;"></span></a>
							</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
<div class="tab-content col-xs-12 border3 borderTopNo p-top5 p-bottom5 p-left10 relative">
	<div class="tab-pane active">
		<div class="p-left0 p5">
			<table class="searchTab">
				<tr>
					<td class="tit commonSearchSaveBox">
						<span class="hide">常用筛选：</span>
						<button class="button btn-gray m-left15" type="button">保存筛选</button>
					</td>
					<td class="order-save-filtrate-modal-box saveFiltrateModalBox">
						<span class="gray-b orderCommonSearchMsg inline-block p-top5">保存筛选记录，高效筛选</span>
					</td>
				</tr>
			</table>
		</div>
	</div>
</div>
<!--右则搜索通用-->
<script>
    $(function () {
        var $keepStateIpt = $('#keepState'),
            keepStateState = $keepStateIpt.data('state'),
            keepStateIsvoided = +$keepStateIpt.data('isvoided'),
            $orderFiltrateIsFoldBox = $('.orderFiltrateIsFoldBox'); //订单list的筛选项
        if(keepStateState || keepStateIsvoided === 1){ //判断当前订单状态不为空（全部订单和已搁置状态为空）或者isvoided=1（已搁置状态isvoided=1）
            //判断订单页是否需要默认折叠list筛选项
            var isDefaultFold = myjStorage.get('isDefaultFold')(), //储存在浏览器中的值，判断是否默认折叠筛选项
                $orderFiltrateFold = $('.orderFiltrateFold'), //订单list的展开、收起icon
                $isDefaultFold = $('.isDefaultFold'), //订单list的默认折叠选项框
                $commonSearchSaveBox = $('.commonSearchSaveBox'),
                $saveFiltrateModalBox = $('.saveFiltrateModalBox');
            if(isDefaultFold && +isDefaultFold){ //如果有值，并且值=1
                $isDefaultFold.val(1).prop('checked',true); //把默认折叠选项框勾选
                $orderFiltrateIsFoldBox.addClass('hide'); //把筛选项隐藏
                $orderFiltrateFold.addClass('order-filtrate-up').removeClass('order-filtrate-down').attr('data-type','hide'); //把展开收起的icon改为对应状态
                $commonSearchSaveBox.find('span').removeClass('hide');
                $commonSearchSaveBox.find('button').addClass('hide');
                $saveFiltrateModalBox.addClass('p-left10');
            }else{ //如果没值
                $isDefaultFold.val(0).prop('checked',false);//把默认折叠选项框取消勾选
                $orderFiltrateIsFoldBox.removeClass('hide'); //把筛选项显示
                $orderFiltrateFold.addClass('order-filtrate-down').removeClass('order-filtrate-up').attr('data-type','show'); //把展开收起的icon改为对应状态
                $commonSearchSaveBox.find('span').addClass('hide');
                $commonSearchSaveBox.find('button').removeClass('hide');
                $saveFiltrateModalBox.removeClass('p-left10');
            }
        }else{
            $orderFiltrateIsFoldBox.removeClass('hide'); //把筛选项显示
        }
    });


</script>
</div>
	<input type="hidden" id="approvedCount" data-all="0" data-merge="0" data-single="0" data-split="0" data-splited="0" />
	<div class="col-xs-12 p0 mTop10">
			<div>
				<div class="dropdown btn-dropdown pull-left">
					<button class="button btn-determine dropdown-toggle" style="width:auto;" type="button" uid="dropdownMenu10" data-toggle="dropdown">
						批量发消息<i class="iconfont icon_down"></i>
					</button>
					<ul class="dropdown-menu menu" role="menu" aria-labelledby="dropdownMenu10">
						<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="batchShowReply(1);">批量给 eBay 发消息</a></li>
						</ul>
				</div>
				<div class="dropdown btn-dropdown pull-left m-left10">
					<button class="button btn-determine dropdown-toggle" style="width:auto;" type="button" uid="dropdownMenu0" data-toggle="dropdown">
						批量操作<i class="iconfont icon_down"></i>
					</button>
					<ul class="dropdown-menu menu" role="menu" aria-labelledby="dropdownMenu0">
						<li class="default">批量操作</li>
						<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="batchBlackList();">批量标记黑名单</a></li>
							<li class="dropdown-submenu selCustomTagsBox">
							<a class="removefromcart dropdownSubmenuA selCustomTagsBtn" href="javascript:">批量标记<span class="myjCaretRight" style="margin-top:3px;color:#999;"></span></a>
							<ul class="dropdown-menu">
								<li class="custom-sign dropdown-batch">
									<div class="signDropdown">
										<div class="cont">
											<ul class="dropBatchSetCusBox">
												<li>
													<a class="signCont moduleA" href="javascript:" data-type="0" uid="moduleA">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleB" href="javascript:" data-type="0" uid="moduleB">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleC" href="javascript:" data-type="0" uid="moduleC">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleD" href="javascript:" data-type="0" uid="moduleD">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleE" href="javascript:" data-type="0" uid="moduleE">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleF" href="javascript:" data-type="0" uid="moduleF">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleW" href="javascript:" data-type="0" uid="moduleW">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleX" href="javascript:" data-type="0" uid="moduleX">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleY" href="javascript:" data-type="0" uid="moduleY">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li>
													<a class="signCont moduleZ" href="javascript:" data-type="0" uid="moduleZ">
														<span class="glyphicon glyphicon-ok signState myj-hide"></span>
														<span class="signContent"></span>
													</a>
												</li>
												<li class="sign-footer">
													<button class="button btn-determine" onclick="batchSetCustomComment(2,this);">确定</button>
													<a class="pull-right" href="javascript:" onclick="batchInitCustomComment();">清除已有标记</a>
												</li>
											</ul>
										</div>
									</div>
								</li>
							</ul>
						</li>
						<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="showBatchComment(0);">批量拣货说明</a></li>
						<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="showBatchComment(1);">批量客服备注</a></li>
					</ul>
				</div>
                <div class="dropdown btn-dropdown pull-right m-left10 menu-right">
						<button class="button btn-determine dropdown-toggle" style="width:auto;" type="button" id="exportOrderMenuAll" data-toggle="dropdown" aria-expanded="false">
							导出订单<i class="iconfont icon_down"></i>
						</button>
						<ul class="dropdown-menu menu" role="menu" aria-labelledby="exportOrderMenuAll">
							<li class="default">导出订单</li>
							<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="showExportModal('order');">按时间导出</a></li>
							<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="showExcelSelectAndAll(0,'');">导出勾选的订单</a></li>
							<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="showExcelSelectAndAll(1,'');">导出全部页订单</a></li>
						</ul>
					</div>
				</div>
		</div>
	<!--右则-->
	<div class="col-xs-12 p0">
		<div class="col-xs-12 p0 mTop10 relative" id="allClassification" data-type="order">
			<div class="normalBtnGroup">
				<div class="dropdown btn-dropdown pull-left m-right10 hide applyingBatchComment">
					<button class="button btn-determine dropdown-toggle" style="width:auto;" type="button" data-toggle="dropdown">
						批量操作<i class="iconfont icon_down"></i>
					</button>
					<ul class="dropdown-menu menu" role="menu" aria-labelledby="dropdownMenu9">
						<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="showBatchComment(0);">批量拣货说明</a></li>
						<li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:" onclick="showBatchComment(1);">批量客服备注</a></li>
					</ul>
				</div>
				</div>
			<div class="printBtnGroup myj-hide">
				</div>
		</div>

		<div id="dxmBody" class="clear-fix"></div>
	</div>
</div>

<div class="modal" id="blacklistBatchModal" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog w500" role="document">
		<div class="modal-content bs-example bs-example-tabs">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="gridSystemModalLabel">标记原因</h4>
			</div>
			<div class="modal-body">
				<div class="m-bottom10">
					<span class="f-red">*</span>
					<span>你认为该买家存在什么不良行为？</span>
				</div>
				<ul class="m-left20" id="reasonList">
					<li>
						<label>
							<input class="m-right5" name="type" type="radio" value="1">
							<span>频繁退货、退款</span>
						</label>
					</li>
					<li>
						<label>
							<input class="m-right5" name="type" type="radio" value="2">
							<span>恶意差评（不合理要求、同行等等）</span>
						</label>
					</li>
					<li>
						<label>
							<input class="m-right5" name="type" type="radio" value="3">
							<span>疑似信用卡诈骗</span>
						</label>
					</li>
					<li>
						<label>
							<input class="m-right5" name="type" type="radio" value="4">
							<span>恶意威胁、敲诈</span>
						</label>
					</li>
					<li>
						<label>
							<input class="m-right5" name="type" type="radio" value="5">
							<span>拍下不付款</span>
						</label>
					</li>
					<li>
						<label>
							<input class="m-right5" name="type" type="radio" value="6">
							<span>偏远地区</span>
						</label>
					</li>
					<li>
						<label>
							<input class="m-right5" name="type" type="radio" value="7">
							<span>货到付款拒收</span>
						</label>
					</li>
					<li>
						<label>
							<input class="m-right5" name="type" type="radio" value="8">
							<span>拒付关税</span>
						</label>
					</li>
					<li>
						<label>
							<input class="m-right5" id="elseType" name="type" type="radio" value="0">
							<span class="m-right10">其他</span>
						</label>
						<input class="form-control inline-block w300 hide" id="elseTypeReason" type="text" maxlength="30" placeholder="说明原因，不超过30个字，选填">
					</li>
				</ul>
			</div>
			<div class="modal-footer">
				<button type="button" class="button btn-determine" onclick="batchSignBlack()">提交</button>
				<button type="button" class="button btn-gray m-left10" data-dismiss="modal">取消</button>
			</div>
		</div>
	</div>
</div>
<div class="modal in-modal" id="deleteBatchOrderModal" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false">
	<div class="modal-dialog w500" role="document">
		<div class="modal-content bs-example bs-example-tabs">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title"></h4>
			</div>
			<div class="modal-body">
				<div class="f16 lh18 f-w600 m-bottom10 m-left5"><i class="f20 iconfont icon_info_outline  m-right10 fRed"></i>确定删除所选订单？</div>
				<div class="m-bottom10 m-left35 f13 gray-c">手工订单删除后不可恢复，请谨慎操作！</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="button btn-delete" onclick="confirmDelOrder()">删除</button>
				<button type="button" class="button btn-gray m-left10" data-dismiss="modal">取消</button>
			</div>
		</div>
	</div>
</div>
<script type="text/html" id="batchEditAdrListItemHtml">
	<tr>
		<td class="w100 minW100 p-left10 f-left v-top p-top8">
			&{orderIdNode}
			<div class="input-group m-bottom5">&{packageNumber}</div>
			<div class="">&{eyeAction}&{eyeActionDecrypt}</div>
		</td>
		<td class="w180 minW180 p-left10 f-left v-top p-top8">
			<div class="input-group m-top3">
				<div class="inline-block &{className}">姓名：</div>
				<div class="inline-block w120" role="detailContact1">&{nameNode}</div>
			</div>
			<div class="input-group m-top10">
				<div class="inline-block &{className}">电话：</div>
				<div class="inline-block w120" role="detailPhone1">&{phoneNode}</div>
			</div>
			<div class="input-group m-top10 m-bottom10">
				<div class="inline-block &{className}">手机：</div>
				<div class="inline-block w120" role="detailMobile1">&{mobileNode}</div>
			</div>
			<div class="input-group m-top10 m-bottom10">
				<div class="inline-block &{className}">邮箱：</div>
				<div class="inline-block w120" role="detailEmail1">&{emailNode}</div>
			</div>
		</td>
		<td class="w180 minW180 p-left10 f-left v-top p-top8">
			<div class="input-group m-top3">
				<div class="inline-block &{className}">公司：</div>
				<div class="inline-block w120">&{companyNode}</div>
			</div>
			<div class="input-group m-top10">
				<div class="inline-block &{className}">税号：</div>
				<div class="inline-block w120">&{taxNumberNode}</div>
			</div>
		</td>
		<td class="w250 minW240 p-left10 f-left v-top p-top8">
			<div class="input-group">
				<div class="inline-block &{className}">国家：</div>
				<div class="inline-block w170">&{countryStr}</div>
			</div>
			<div class="input-group m-top10">
				<div class="inline-block &{className}">省州：</div>
				<div class="inline-block w170">&{provincesNode}</div>
			</div>
			<div class="input-group m-top10">
				<div class="inline-block &{className}">城市：</div>
				<div class="inline-block w170">&{cityNode}</div>
			</div>
			<div class="input-group m-top10 m-bottom10">
				<div class="inline-block &{className}">邮编：</div>
				<div class="inline-block w170">&{zipNode}</div>
			</div>
		</td>
		<td class="w240 minW240 p-left10 f-left v-top p-top8">
			<div class="m-top3">
				<div class="inline-block w50 &{className}">地址1：</div>
				<div class="inline-block w170 m-left2" role="detailAddr11">&{detailAddressNode}</div>
			</div>
			<div class="m-top10">
				<div class="inline-block w50 &{className}">地址2：</div>
				<div class="inline-block w170 m-left2" role="detailAddress21">&{address2Node}</div>
			</div>
			<div class="input-group m-top10 m-bottom10">
				<div class="inline-block &{className}">门牌号：</div>
				<div class="inline-block w170">&{apartmentNumberNode}</div>
			</div>
		</td>
		<td class="removeAddr w80 min80 maxW80 v-top p-top8">
			<div><a href="javascript:" onclick="removeAddrObj(this);">移除</a></div>
			<div>&{editBtn}</div>
		</td>
	</tr>
</script>
<script type="text/javascript">
	/** 显示批量导入发货窗口  **/
	var showImportShipping = function (val){
		importShippingUp.cancel("*");
		$("#importShippingFileName").text("请选择你要导入的文件，目前支持EXCEL");
		if(val == 0){
			$("#importTemplateDiv").attr("href","//www.dianxiaomi.com/static/importTemplate/import_package_information_template.xlsx?v=1.7");
			$("#importShippingLabel").html("导入包裹号发货");
			importShippingUpFormData = {"isOrder" : 0};
			importShippingUp.settings('formData', importShippingUpFormData);
			$("#orderPackageSpan").html("包裹号");
		} else {
			$("#importTemplateDiv").attr("href","//www.dianxiaomi.com/static/importTemplate/import_logistics_information_template.xlsx?v=1.7");
			$("#importShippingLabel").html("导入订单号发货");
			importShippingUpFormData = {"isOrder" : 1};
			importShippingUp.settings('formData', importShippingUpFormData);
			$("#orderPackageSpan").html("订单号");
		}
		$("#importShippingModal").modal('show');
	};

	/** 获取无打印发货和导入发货的成功信息 **/
	var getSuccessMsg = function(successList){
		var successMsg  = "";
		if(successList != null){
			var processNum = 0;
			var allOutNum  = 0;
			var shippedNum = 0;
			for(var i=0;i<successList.length;i++){
				var state = successList[i].obj;
				if(state == 'processed'){
					processNum++;
				} else if(state == 'allocated_out'){
					allOutNum++;
				} else if(state == 'shipped'){
					shippedNum++;
				}
			}
		}
		if(processNum > 0){
			successMsg += processNum+"个订单虚拟发货，已移入到「运单号申请」页！";
		}
		if(allOutNum > 0){
			successMsg += "<br/>"+allOutNum+"个订单缺货，已移入到「缺货」页！";
		}
		if(shippedNum > 0){
			successMsg += "<br/>"+shippedNum+"个订单有货，已移入到「已发货」页！";
		}
		return successMsg;
	};

	/** 批量导入发货  **/
	var importShippingUpFormData = {'isOrder' : 0},
			importShippingUp = $('#importShippingUpload').Huploadify({
	    'auto':false,
	    'fileObjName'   : 'FileData',
	    'fileTypeExts': '*.xlsx;*.xls', //允许的格式
	    'multi':false,
	    'fileSizeLimit':2048,
	    'removeTimeout':500,
	    'showUploadedPercent':false,
	    'buttonClass': 'button btn-determine btn-block',
	    'buttonText': '选择导入文件',
	    'formData' : importShippingUpFormData,
	    'uploader' : 'package/batchImportShipping.json',
	    onUploadStart:function(){
	    	$('#importShippingModal').modal('hide');
	    	$('#loading').modal('show');
	    },
	    onSelect:function(files){
	    	for(var i=0,len=files.length;i<len;i++){
	        	$("#importShippingFileName").text(files[i].name);
	    	}
	    	return false;
	    },
	    onStop:function(files){
	    	return false;
	    },
	    'onUploadSuccess':function(file, data, response){
	    	data = $.parseJSON(data);
	    	if(data != null){
	    		$('#loading').modal('hide');
	    		var successList = data.successList;
	        	var failList 	= data.failList;
				var successMsg  = getSuccessMsg(successList);
				batchReturnProcess(successList, failList,successMsg,importShippingUpFormData);
	        	refreshAjaxPage();
	    	}
		}
	});

	/** 批量导入发货提交处理  **/
	var importShppingSubmit = function(){
		if ($.trim($('#importShippingFileName').text()) === '请选择你要导入的文件，目前支持EXCEL') {
			$.fn.message({type: 'error', msg: '请选择导入文件'});
			return;
		}
		importShippingUp.upload('*');
	};

	/** 同步订单 **/
	var syncOrder = function(){
		var $keepState = $('#keepState'),
			platform = $keepState.data('platform'),
			shopId = $keepState.data('shopid'),
			postData = {
				shopId: shopId,
				platform: platform
			},
			$shopGroupId = $('#shopGroupId'),
			shopGroupId = $shopGroupId.length ? $.trim($shopGroupId.val()) : '';

		if (shopGroupId) postData.shopGroupId = shopGroupId;//如果选中了店铺分组，则加上店铺分组参数作为筛选条件
		commonProgressBarModalShow({
			title: '同步订单',
			ajaxUrl: 'order/syncOrder.json',
			ajaxData: postData,
			closeCallback: function () {
				refreshAjaxPage();
			}
		});
	};

	 /**批量导出订单**/
	 var batchExportOrder = function(exportKeys, templateId, url, packageIds){
		var $keepState = $('#keepState'),
			orderField = $keepState.data('orderfiled'), //排序字段
		 	isSearch = $keepState.data('search'), //升序or降序
		 	$batchCheckReplicaProgressBar = $('#batchCheckReplicaProgressBar'),
			$batchCheckReplicaProcessNum = $('#batchCheckReplicaProcessNum'),
		 	$reportShow = $('#reportShow'),
			p = 0, // 记录进度条的值
			dataObj = {};
		if (orderField == undefined) {
			orderField = 'shipped_time';
		}
		if(packageIds == undefined){
			packageIds = '';
		}
		url += '&orderField=' + orderField + '&isSearch=' + isSearch;
		$('#exportPackageKeys').val(exportKeys);
		$('#exportTemplateId').val(templateId);
		$('#upDownloadbox').empty();
		$('#batchExportOrderModal').modal('show');
		 /*2017.2.10 byzym 二次刷新初始化*/
		 $batchCheckReplicaProgressBar.css('display', 'none');
		 setTimeout(function(){
			 $batchCheckReplicaProgressBar.css({'width': '0%', 'display': ''});
		 },10);
		 $batchCheckReplicaProcessNum.html('0');
		 $reportShow.empty().css('color', '');
		 $('div[uid="downloadFill"]').removeClass('btn-dropdown').find('button[uid="dropdown"]').removeClass('btn-determine').addClass('btn-gray').prop('disabled', true).css('color', '#000000');
		 dataObj = {
			 templateId: templateId,
			 packageIds: packageIds,
			 exportKeys: exportKeys
		 };
		 if(url.indexOf('json?') !== -1){ //url上带的参数内容中如果包含+，请求时+会被转成空格，比如：content=abc+123，请求时会变成content=abc 123
			 try{
				 var datas = url.split('json?'),
					 newDataObj = {};
				 $.each(datas[1].split('&'), function(i, j){
					 newDataObj[j.split('=')[0]] = j.split('=')[1]; //把url带的参数都取出来
				 });
				 url = datas[0] + 'json'; //重新拼接url
				 dataObj = $.extend(dataObj, newDataObj); //把对象合并
			 }catch(e){}
		 }
		$.ajax({
			type: 'POST',
			url: url,
			data: dataObj,
			dataType: 'json',
			success: function(data){
				var uuid = data.uuid;
                checkProcessStatus(uuid, function(data){
					var num = Math.round(data.num / data.totalNum * 100);
					if(num < p && +data.code !== 1){
						// 为了去掉变为n->0时的动画效果，在此先隐藏，然后再置0，最后再定时显示出来
						$batchCheckReplicaProgressBar.css('display', 'none');
						setTimeout(function(){
							$batchCheckReplicaProgressBar.css('display', '');
						},1000);
					}
					p = num;
					if(+data.code === 0 && (!data.msg || data.msg === 'loading')){
						$batchCheckReplicaProgressBar.css('width', num + '%');
						$batchCheckReplicaProcessNum.text(data.num);
						$reportShow.text('订单导出数据准备中，请稍等');
					} else if(+data.code === 0 && data.msg === 'run'){
						$batchCheckReplicaProgressBar.css('width', num + '%');
						$batchCheckReplicaProcessNum.text(data.num);
						$reportShow.text('订单正在导出中，请稍后下载...');
					} else if(+data.code === 1 && data.msg === 'stop'){
						$batchCheckReplicaProgressBar.css('width', '100%').removeClass('active');
						$reportShow.text('有新的导出任务，已暂停这个导出任务！').css('color', 'red');
                    }else if(data.code === -1){
						$batchCheckReplicaProgressBar.css('width', '100%');
						$batchCheckReplicaProcessNum.text(data.num);
						$reportShow.text(data.msg).css('color', 'red');
					}else {
						$batchCheckReplicaProgressBar.css('width', '100%').removeClass('active');
						$batchCheckReplicaProcessNum.text(data.totalNum);
						$reportShow.empty().html('导出文件已生成，文件将会在5分钟后失效,请立即下载<br/>');
						if (data.msg) {
							var downUrl = data.msg.split('|'),
								li = '',
								spanStr = '',
								size = 10000,
								start = 1,
								end;
							if (downUrl.length > 1) {
								$.each(downUrl, function (i, val) {
									if (i == downUrl.length - 1) {
										end = data.totalNum;
									} else {
										end = start - 1 + size;
									}
									spanStr += '<span class="inline-block" style="width: 33.33%;line-height: 30px;"><a role="menuitem" tabindex="-1" href="' + val + '">下载文件(' + start + '-' + end + ')</a></span>';
									start += size;
								});
								$('#upDownloadbox').html(spanStr);
								$reportShow.html('由于文件过大，已拆分为 ' + downUrl.length + '个文件<br/>');
							} else {
								var msg = data.msg,
									msgOver = getDownloadUrl(msg);

								$('div[uid="downloadFill"]').addClass('btn-dropdown').find('button[uid="dropdown"]').removeClass('btn-gray').addClass('btn-determine').prop('disabled', false).css('color', '#FFFFFF');
								$('.highSpeedDownload').find('a').attr('href', msg);
								$('.standbDownload').find('a').attr('href', msgOver);
							}
						}
					}
				});
			},
			error:function(msg){
			}
		});
	 };

	/**批量导出订单（高级搜索）**/
	var batchExportOrderAdvanced = function(exportKeys,templateId,url){
		$("#exportPackageKeys").val(exportKeys);
		$("#exportTemplateId").val(templateId);
		$("#upDownloadbox").empty();
		$("#batchExportOrderModal").modal("show");
		/*2017.2.10 byzym 二次刷新初始化*/
		$("#batchCheckReplicaProgressBar").css("display", "none");
		setTimeout(function(){
			$("#batchCheckReplicaProgressBar").css("width", 0+"%");
			$("#batchCheckReplicaProgressBar").css("display", "");
		},10);
		$("#batchCheckReplicaProcessNum").html("0");
		$("#reportShow").empty();
		$('div[uid="downloadFill"]').removeClass('btn-dropdown').find('button[uid="dropdown"]').removeClass('btn-determine').addClass('btn-gray').prop('disabled', true).css('color','#000000');
		$("#reportShow").css("color","");
		var p = 0;		// 记录进度条的值

		//为了控制每页显示的条数，增加pagesize
		var serializeArray = $('#advancedForm').serializeArray(), //获取到form表单中所有需要提交的数据，这是一个[{name:'key',value:'value'}]的格式的数据
			serialize = [], //获取高级搜索form表单需要提交的数据
			serializeLen = 0, //获取包裹类型的checkbox的name值对应数组的下标
			isProductStatus = {}; //用来判断包裹类型是否已经push到数组中
		$.each(serializeArray,function(i,j){ //循环数据，因为form表单提交checkbox的值是无法自动逗号拼接，所以需要循环处理一下
			if(j.name === 'productStatus'){ //如果当前name=productStatus
				if(isProductStatus[j.name]){ //判断对象key = 'productStatus'的value是否为true
					//找到数组对应下标的值，进行逗号拼接value，最后这个下标的值会是productStatus=xx,xx,xx
					serialize[serializeLen] += (serialize[serializeLen].split('=')[1] ? ',' : '') + j.value;
				}else{ //如果不为true
					serialize.push(j.name + '=' + j.value); //先直接赋值
					serializeLen = serialize.length - 1; //获取当前数组长度
					isProductStatus[j.name] = true; //给对象key = 'productStatus' 的value赋值为true
				}
			}else{//如果不等于则直接把name和value拼接
				serialize.push(j.name + '=' + j.value);
			}
		});
		$.ajax({
			type: "POST",
			url: url,
			data: serialize.join('&'), //把处理之后的数据使用&拼接成字符串
			dataType: "json",
			success: function(data){
				var uuid = data.uuid;
				checkProcessStatus(uuid, function(data){
					var num 	= Math.round(data.num / data.totalNum * 100);
					if(num<p && data.code!=1){
						// 为了去掉变为n->0时的动画效果，在此先隐藏，然后再置0，最后再定时显示出来
						$("#batchCheckReplicaProgressBar").css("display", "none");
						setTimeout(function(){
							$("#batchCheckReplicaProgressBar").css("display", "");
						},1000);
					}
					p = num;
					if(data.code==0 && (data.msg == '' || data.msg == 'loading') ){
						$("#batchCheckReplicaProgressBar").css("width", num + "%");
						$("#batchCheckReplicaProcessNum").text(data.num);
						$("#reportShow").text("订单导出数据准备中，请稍等");
					} else if(data.code==0 && data.msg == 'run'){
						$("#batchCheckReplicaProgressBar").css("width", num + "%");
						$("#batchCheckReplicaProcessNum").text(data.num);
						$("#reportShow").text("订单正在导出中，请稍后下载...");
					} else if(data.code == -1){
						$("#batchCheckReplicaProgressBar").css("width", "100%");
						$("#batchCheckReplicaProcessNum").text(data.num);
						$("#reportShow").text(data.msg).css("color","red");
					}else {
						$("#batchCheckReplicaProgressBar").css("width", "100%");
						$("#batchCheckReplicaProgressBar").removeClass("active");
						$("#batchCheckReplicaProcessNum").text(data.totalNum);
						$("#reportShow").empty();
						$("#reportShow").html('导出文件已生成，文件将会在5分钟后失效,请立即下载<br/>');
						if (data.msg) {
							var downUrl = data.msg.split("|"),
									li = '', spanStr = '',
									size = 10000,
									start = 1,
									end;
							if (downUrl.length > 1) {
								$.each(downUrl, function (i, val) {
									if (i == downUrl.length - 1) {
										end = data.totalNum;
									} else {
										end = start - 1 + size;
									}
									spanStr += '<span class="inline-block" style="width: 33.33%;line-height: 30px;"><a role="menuitem" tabindex="-1" href="' + val + '">下载文件(' + start + '-' + end + ')</a></span>';
									start += size;
								});
								$('#upDownloadbox').html(spanStr);
								$("#reportShow").html('由于文件过大，已拆分为 ' + downUrl.length + '个文件<br/>');
							} else {
								$('div[uid="downloadFill"]').addClass('btn-dropdown').find('button[uid="dropdown"]').removeClass('btn-gray').addClass('btn-determine').prop('disabled', false).css('color','#FFFFFF');
								$('.highSpeedDownload').find('a').attr('href',data.msg);
								var msg = data.msg;
								var msgOver = getDownloadUrl(msg);
								$('.standbDownload').find('a').attr('href',msgOver);
							}
						}
					}
				});
			},
			error:function(msg){
			}
		});
	};

	 $(document).on('click','.toAll',function(){
		var objParent = $(this).closest('tr'),
			objTable = $(this).closest('.myj-table');
		for (var i = 1;i<5 ;i++ ) {
			var str = $(objParent).find('td[data-val="'+i+'"] input').val();
			$(objTable).find('tr td[data-val="'+i+'"] input').val(str);
		}
	 });

    $(document).on('click','#selectAll',function() {
        var selectAll = $(this).is(':checked');
        if (!selectAll) {
            $('.normalBtnGroup').removeClass('myj-hide');
            $('.printBtnGroup').addClass('myj-hide'); //控制打印面单按钮隐藏
        }
	});

	 /** 立即处理错误信息 **/
	 var goShipCommitFail = function(){
		 setShipped('m10402', 'shipped', 'fail');
	 };

	 /** 定时 **/
	 var countdown = 5;
	 var setShipErrTime = function(flag) {
		if (countdown == 0) {
	 		$("#shipErrPropBtn").text("稍后处理");
			$("#shipErrPropBtn").prop('disabled', false);
			countdown = 5;
			flag = 0;
		} else {
			$("#shipErrPropBtn").prop('disabled', true);
			$("#shipErrPropBtn").text("稍后处理（"+countdown+"）");
			countdown--;
		}
		if(flag == 1){
			setTimeout("setShipErrTime("+ flag +")",1000);
		}
	};

	/** 设置发货错误提示 **/
	 var setShipErrProp = function(obj){
		 var puid = '1411053';
		 var date1 = new Date();
		 date1 = date1.toLocaleDateString();
		 var key = "t1002";
		 var val = {};
		 val[puid] = date1;
		 if(!$(obj).is(":checked")){
		  	val = {};
		 }
		 myjStorage.objSet(key,val)();
	 };

	document.onreadystatechange = function(){
		//document.readyState有“interactive”和“complete”两个值
		if(document.readyState == "complete" ){
			(function($){
				var failCount = $("#shippedFailNum").text(),
						behindTrackCount = $("#behindTrackCountLeft").val(),
						failNum = failCount - behindTrackCount;
				if(failNum > 0){
					var puid = 1411053;
					var key = "t1002";
					var date1 = new Date();
					date1 = date1.toLocaleDateString();
					var commitPlatform = '';
					if(commitPlatform != 'fail'){
						var obj = myjStorage.objGet(key)();
						if(obj != null){
							var date2 = obj[puid];
							if(date2){
								if(myjStorage.dateDiff(date2,date1) > 0){
									// 提示弹窗
									$("#shipErrorPromptModal").modal("show");
									setShipErrTime(1);
								}
							} else {
								// 提示弹窗
								$("#shipErrorPromptModal").modal("show");
								setShipErrTime(1);
							}
						} else {
							// 提示弹窗
							$("#shipErrorPromptModal").modal("show");
							setShipErrTime(1);
						}
					}
				}
			})(jQuery)
		}
	};

    $(document).off('click', '#blacklistBatchModal #reasonList input[name="type"]')
        .on('click', '#blacklistBatchModal #reasonList input[name="type"]', function () {
            var value = $.trim($(this).val());
            if (+value === 0) {
                $('#blacklistBatchModal').find('#elseTypeReason').removeClass('hide');
            } else {
                $('#blacklistBatchModal').find('#elseTypeReason').addClass('hide');
            }
        });

	// 速卖通订单详情保存快递
	var smtOrderDetailSaveExpress = function (shippingId, expressId) {
		var userId = '1411053';

		myjStorage.storageObj().setItem(userId + '_smtOrderDetailSaveExpress_' + shippingId,  expressId);
	};

	var getSmtDetailOrderSaveExpress = function (shippingId) {
		var userId = '1411053';

		return myjStorage.storageObj().getItem(userId + '_smtOrderDetailSaveExpress_' + shippingId);
	};

	// 关闭物流运单号查询的iframe
	$('.jcTrackIframe').remove();

	publicHoverTextCanBeMovedIn('.myjSquare', 'top', false);

</script>
